package com.health.mapp.impl;

import java.math.BigDecimal;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;

import com.health.db.model.EPayCashPayment;
import com.health.db.service.sm.IWXPayService;
import com.health.mapp.bean.Header;
import com.health.mapp.interImpl.PayActionServerImpl;
import com.health.mapp.utils.Constant;
import com.health.mapp.utils.Response;

public class WXTestImpl implements ActionInterface{
	
	private static Logger logger=Logger.getLogger(WXTestImpl.class);
	
	@Autowired
	private IWXPayService wXPayService;
	
	
	@Override
	public Response execute(Header header, Object reqBean) throws Exception {
		
		
		//String out_trade_no = "1000130529-457-61";
		String out_trade_no = "1177-150-81";
		
		String total_amount= "36000";
		EPayCashPayment payment = new EPayCashPayment();
		
		payment.setBankCashIdno("BBBBBBBBBBB");
		payment.setPaycashTotal(new BigDecimal(total_amount)); 
		
		PayActionServerImpl impl = new PayActionServerImpl();
		impl.updatePayCashPaymentLog(out_trade_no, payment);
		
		try {
			impl.payAction(out_trade_no, Constant.CONSTANTS_PAYMENT_WEIXIN);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	
	}


	public IWXPayService getwXPayService() {
		return wXPayService;
	}


	public void setwXPayService(IWXPayService wXPayService) {
		this.wXPayService = wXPayService;
	}
}
